#ifndef CHATLOGWIDGET_H
#define CHATLOGWIDGET_H

#include <QTextBrowser>
#include <QScrollBar>
#include "Chat.h"

#define EMPTY_INPUT 1

class ChatLogWidget : public QTextBrowser {

    Q_OBJECT

public:
    explicit ChatLogWidget(QWidget *parent = 0);
    void append(QString chat, Chat::ChatType type);

signals:

public slots:

private:
    void initializeStyleSheet();

    QScrollBar * chatScrollBar;
    QTextDocument * chatHtml;
    QTextCursor * chatCursor;
    QTextBlockFormat standardFormat;
    QTextBlockFormat indentedFormat;

    Chat::ChatType lastChatType;
    bool firstBlock;
    bool scrolledBottom;

};

#endif // CHATLOGWIDGET_H
